{if $logged} 

Logged <br />

<form action="/myprofile/update" method="post" enctype="multipart/form-data">
<fieldset>
	<p>
	<label> Username </label>
	<input type="text" name="username" value="{$username}" /> 
	</p>
	
	<p>
	<label> First name </label>
	<input type="text" name="first_name" value="{$first_name}" /> 
	</p>
	
	<p>
	<label> Last name </label>
	<input type="text" name="last_name" value="{$last_name}" /> 
	</p>
	
	<p>
	<label> Date of birth </label>
	<select name="birth_day">
	{section name=foo loop=31}
		<option value="{$smarty.section.foo.index+1}" {if $smarty.section.foo.index+1==$birth_day}selected{/if} >{$smarty.section.foo.index+1}</option>
	{/section}
	</select>
	<select name="birth_month">
		{foreach from=$months key=key item=month}
		<option value="{$key}" {if $key==$birth_month}selected{/if}> {$month} </option>
		{/foreach}
	</select>
	<select name="birth_year">
	{section name=foo loop=100}
		<option value="{$smarty.section.foo.index+1910}" {if $smarty.section.foo.index+1910==$birth_year}selected{/if}>{$smarty.section.foo.index+1910}</option>
	{/section}
	</select>
	</p>
	
	<p>
	<label> Gender </label>
	<select name="gender">
		<option value="M" selected > M </option>
		<option value="F" {if $gender=="F"} selected {/if} > F </option>
	</select>
	</p>
	
	<p>
	<label> Address </label>
	<textarea name="address">{$address}</textarea> 
	</p>
	
	<p>	
	<label> City </label>
	<input type="text" name="city" value="{$city}" /> 
	</p>
	
	<p>
	<label> Country </label>
	<input type="text" name="country" value="{$country}" /> 
	</p>
	
	<p>
	<label> Website </label>
	<input type="text" name="website" value="{$website}" /> 
	</p>
	
	<p>
	<label> E-Mail </label>
	<input type="text" name="email" value="{$email}" /> 
	</p>
	
	<p>
	<label> Joined </label>
	<input type="text" name="joined" value="{$joined}" readonly="" /> 
	</p>
	
	<p>
	<label> Personal Comment </label>
	<textarea name="comment">{$comment}</textarea> 
	</p>
	
	<p>
	<label> Penalties </label>
	<textarea name="penalties" readonly="">{$penalties}</textarea> 
	</p>
	
	<p>
	<label> Avatar </label>
	<input type="file" name="avatar">
	{if $avatar}
	<img src='/avatars/{$avatar_file}' />
	{/if}
	
	</p>
	
	<input type="submit" value="Update">
</fieldset>
</form>

<form action="/myprofile/changepassword" method="post">
<fieldset>
	<p>
		<label>
			Old password
		</label>
		<input type="password" name="old_password" value=""/>
	</p>
	
	<p>
		<label>
			New password
		</label>
		<input type="password" name="new_password" value=""/>
	</p>
	
	<p>
		<label>
			Repeat new password
		</label>
		<input type="password" name="rep_password" value=""/>
	</p>
	<p>
		<input type="submit" value="Change">
	</p>
</fieldset>
</form>

{else} Not logged
{/if}

